home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs55.d81
/
cpwrdocs.arc
/
OUTLINE.TWO
< prev
Wrap
Text File
|
2009-10-10
|
4KB
|
158 lines
--------------------------------------
├ ╨OWER ├
╒SER'S ╧UTLINE PART 2
--------------------------------------
├OMPILER (CC.SH,COMPILER,TRANSLATOR) -
┴T THE SHELL PROMPT TYPE ($) TYPE
'CC [-P] FILENAME.C' <RETURN>
AND THE COMPILER WILL BE LOADED AND
RUN WITH THE SPECIFIED 'FILENAME.C'.
╔F YOU TYPE IN THE '-P' PRIOR TO THE
'FILENAME.C' THE COMPILER WILL ASSUME
THAT YOU ARE USING TWO DISK DRIVES.
╔F YOU HAVE 1 DISK DRIVE AND HAVE
CREATED A COMBINATION SYSTEM-WORK DISK
AS DESCRIBED IN PART ONE YOU CAN USE
THE '-P' SWITCH TO MAKE THE COMPILER DO
A COMPLETE COMPILE WITHOUT PROMPTING
YOU TO SWAP DISKS.
╘HE FILENAME SHOULD ┴╠╫┴┘╙ END WITH
'.C'. ╫HEN FINISHED, THE COMPILER WILL
LEAVE AN OBJECT FILE ON THE WORK DISK
WITH THE SAME NAME AS THE SOURCE FILE
EXCEPT THE EXTENSION '.C' WILL BE
REPLACED WITH '.O' TO INDICATE AN
OBJECT FILE.
╔T IS A GOOD IDEA TO KEEP YOUR SOURCE
CODE FILES TO A SIZE OF 35 BLOCKS OR
LESS SINCE THE COMPILER WILL COMPLAIN
AND REFUSE TO PROCESS FILES THAT ARE
TOO LARGE. ╞OR LARGE PROGRAMS THIS
MEANS A PROGRAM WILL BE COMPOSED OF
MORE THAN ONE SOURCE FILE. ╔F THIS IS
NECESSARY CONSULT A TUTORIAL BOOK ON
HOW TO USE THE 'EXTERN' VARIABLE
DECLARATOR FOR VARIABLES SHARED BETWEEN
TWO OR MORE SOURCE FILES.
╘RIM (TRIM.SH) -
╘RIM OPTIMIZES OBJECT MODULES PRODUCED
BY THE COMPILER (IE. ENDING IN '.O' OR
'.OBJ') PRIOR TO PROGRAM LINKING. ╞ILE
SIZES ARE REDUCED FROM 3 TO 12 PER
CENT. ╘O USE TRIM LOAD IT WITH:
$ LOAD TRIM
╘HEN TRIM YOUR OBJECT MODULE(S) WITH:
$ TRIM [FILENAME.O]
─O NOT TRIM A FILE MORE THAN ONCE.
╠INKER (LINK.SH) -
┴T THE SHELL PROMPT ($), TYPE IN
'LINK [-S] [ADDRESS] <RETURN>' TO
LOAD AND RUN THE LINKER. ╘O LINK A
PROGRAM TO RUN WITHIN THE SHELL LEAVE
OUT THE '-S' OPTION. ╒SING THE '-S'
OPTION WILL TELL THE LINKER YOU WANT
YOUR PROGRAM TO RUN FROM ┬┴╙╔├ AND
INDEPENDENTLY OF THE ├ ╨OWER SHELL.
┴LL PROGRAMS WHICH ARE TO RUN INSIDE
THE SHELL MUST END WITH '.SH'. ╔F NO
'ADDRESS' IS GIVEN THE PROGRAMS WILL BE
LINKED TO START AT THE DEFAULT LOCATION
SO THAT THEY CAN BE ╠╧┴─ED AND ╥╒╬. ╔F
AN ADDRESS IS SPECIFIED,IN EITHER
HEXADECIMAL (WHICH IS PRECEEDED BY $)
OR DECIMAL, THEN THE PROGRAM WILL BE
LINKED TO LOAD STARTING AT THAT ADDRESS
AND YOU WILL USUALLY HAVE TO 'SYS' FROM
WITHIN ┬┴╙╔├ TO THAT STARTING ADDRESS
TO RUN THE PROGRAM.
╘HE LINKER LOOKS FOR YOUR OBJECT FILES
WHICH END IN '.O' ON THE WORK DISK AND
THE LIBRARY FILES ARE LOOKED FOR ON THE
SYSTEM DISK. ╫ITH 1 DRIVE THE SYSTEM
AND WORK DISKS ARE ON THE SAME DRIVE.
╘HE LINKER WILL ONLY ACCEPT FILES WHOSE
NAMES END WITH '.O', '.OBJ' OR '.L'.
╘HE LINKER PROMPT IS A '>'. ╘YPE IN THE
NAME(S) OF YOUR OBJECT '.O' FILES AT
THE PROMPT, HITTING <RETURN> AFTER EACH,
WHICH MEANS ONLY ONE ON EACH LINE AS
THEY WILL BE LOADED BY THE LINKER ONE
AT A TIME.
╫HEN YOU HAVE FINISHED THIS YOU EITHER
INSERT THE LIBRARY DISK IF YOU ARE
WORKING WITH ONLY ONE DRIVE, OR IF YOU
HAVE 2 DRIVES GO ON DIRECTLY TO
PRESSING '^'(ARROW UP) THEN <RETURN>.
╘HIS WILL TELL THE LINKER TO LINK IN
THE NEEDED FUNCTIONS FROM THE STANDARD
LIBRARY AND THE SYSTEM LIBRARY.
╔F YOU HAVE OBJECT MODULES IN A LIBRARY
YOU'VE CREATED YOURSELF THEN JUST GIVE
THE WHOLE LIBRARY NAME, INCLUDING THE
REQUIRED '.L' EXTENSION, AT THE LINKER
PROMPT AND ╠╔╬╦ WILL SEARCH IT FOR ANY
OBJECT MODULES THAT ARE CALLED FROM
WITHIN YOUR PROGRAM.
╫HEN THIS IS FINISHED HIT <RETURN>. ╔F
YOU GET AN "UNRESOLVED EXTERNAL
REFERENCE" MESSAGE THEN YOU FORGOT TO
LINK IN SOMETHING. ╬O PROBLEM, JUST
LINK IN THAT SOMETHING NOW.
╔F YOU NEED TO EXIT THE LINKER FOR ANY
REASON JUST ENTER AN 'X' AT THE LINKER
PROMPT AND HIT <RETURN> TO GET BACK TO
THE SHELL.
╧NCE EVERYTHING IS LINKED YOU ARE ASKED
FOR THE NAME OF THE PROGRAM TO BE SAVED
TO DISK WITH THE MESSAGE:
OUTPUT FILE:
┴ TYPICAL SIMPLE LINK TO MAKE A FILE
TO RUN FROM ┬┴╙╔├ (OUTSIDE THE SHELL)
WOULD GO SOMETHING LIKE THIS:
LINK -S
> FILENAME.O (YOUR FIRST OBJECT FILE)
> FILENAME.O (YOUR SECOND OBJECT FILE
IF YOU HAVE ONE)
> ^ (STANDARD LIBRARY STUFF)
> MYLIB.L (A USER-CREATED LIBRARY)
> <RETURN> (YOU ARE DONE LINKING)
OUTPUT FILE: FILENAME (OF YOUR CHOICE)
╘O LINK A FILE TO RUN WITHIN THE ├ ╨OWER
SHELL JUST USE 'LINK' WITHOUT THE '-S'
ON THE COMMAND LINE AND WHEN ASKED FOR
'OUTPUT FILE:' YOU ═╒╙╘ PUT AN '.SH'
AT THE END OF THE FILENAME. ╬OTE THAT
TO RUN SUCH A PROGRAM YOU JUST GIVE ITS
NAME WITHOUT THE '.SH' AT THE '$'.
- END -